#include<iostream>
using namespace std;


const int N = 1e7 + 10;
int a[N];

int n, x;

int main()
{
    cin >> n >> x;
    for (int i = 1; i <= n; i++) cin >> a[i];

    int left = 0, right = 0, sum = 0;
    int retleft = -1, retright = -1, retlen = N;
    while (right <= n)
    {
        sum += a[right];
        while (sum >= x)
        {
            if (right - left + 1 < retlen)
            {
                retleft = left;
                retright = right;
                retlen = right - left + 1;
            }
            sum -= a[left++];
        }

        right++;
    }

    cout << retleft << " " << retright << endl;

    return 0;
}